package iotest.stream;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "cxk";
        int age = 25;
        char gender = '男';
        String other = "唱跳rap篮球";
        Student kk = new Student(name, age, gender, other);
        FileOutputStream fos = new FileOutputStream("kk.dat");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(kk);

        System.out.println("写完了");
        oos.close();


    }
}
